package com.cpz.knife4j.controller.common;

import com.cpz.starter.bean.MyBean;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cpz
 * @since 2022/09/28
 */
@Api(tags = "首页模块")
@RestController
@RequiredArgsConstructor
public class IndexController {

    @Parameter(name = "姓名", description = "姓名", required = true)
    @Operation(summary = "向客人问好")
    @GetMapping("/say")
    public String sayHi(@RequestParam(value = "name")String name){
        return "Hi:"+name;
    }

    private final MyBean myBean;

    @Operation(summary = "测试自定义 Spring Boot Starter")
    @GetMapping("/bean/test")
    public String beanTest() {
        return myBean.sayHi();
    }
}
